import request from '@neu/biz-core/utils/request'
const baseUrl = 'dcom/api/w/inspection/task'

export const list = (params) => {
  return request({
    url: baseUrl,
    params,
    method: 'get'
  })
}

export const page = (params) => {
  return request({
    url: baseUrl + '/p',
    params,
    method: 'get'
  })
}

export const detail = (id) => {
  return request({
    url: baseUrl + '/' + id,
    method: 'get'
  })
}

export const update = (id, data) => {
  return request({
    url: baseUrl + '/' + id,
    data,
    method: 'put'
  })
}

export const submit = (id, data) => {
  return request({
    url: baseUrl + '/submit/' + id,
    data,
    method: 'put'
  })
}

export const claim = (id) => {
  return request({
    url: baseUrl + '/claim/' + id,
    method: 'put'
  })
}

export const exportExcel = (params) => {
  return request({
    url: baseUrl + '/export',
    params,
    method: 'get',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    }
  })
}
